using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using BVMB.DataLayer.BusinessObjects;
using BVMB.DataLayer.Base;

namespace BVMB.DataLayer.ManagerObjects
{
    public partial interface IChuyenBayManager : IManagerBase<BVMB.DataLayer.BusinessObjects.ChuyenBay, int>
    {
		// Get Methods
		IList<ChuyenBay> GetBySanBayDen(System.Int32 sanBay1);
		IList<ChuyenBay> GetBySanBayDi(System.Int32 sanBay2);
    }

    partial class ChuyenBayManager : ManagerBase<BVMB.DataLayer.BusinessObjects.ChuyenBay, int>, IChuyenBayManager
    {
		#region Constructors
		
		public ChuyenBayManager() : base()
        {
        }
        public ChuyenBayManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<ChuyenBay> GetBySanBayDen(System.Int32 sanBay1)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(ChuyenBay));
			
			
			ICriteria sanBay1Criteria = criteria.CreateCriteria("SanBay1");
            sanBay1Criteria.Add(NHibernate.Criterion.Expression.Eq("Id", sanBay1));
			
			return criteria.List<ChuyenBay>();
        }
		
		public IList<ChuyenBay> GetBySanBayDi(System.Int32 sanBay2)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(ChuyenBay));
			
			
			ICriteria sanBay2Criteria = criteria.CreateCriteria("SanBay2");
            sanBay2Criteria.Add(NHibernate.Criterion.Expression.Eq("Id", sanBay2));
			
			return criteria.List<ChuyenBay>();
        }
		
		#endregion
    }
}